vditor 3.11.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +1 -0
  2. package/dist/index.css +32 -79
  3. package/dist/index.js +3762 -3993
  4. package/dist/index.min.js +1 -1
  5. package/dist/js/lute/lute.min.js +2 -2
  6. package/dist/method.js +15 -6
  7. package/dist/method.min.js +1 -1
  8. package/dist/ts/sv/index.d.ts +1 -5
  9. package/dist/ts/sv/process.d.ts +1 -3
  10. package/dist/ts/upload/getElement.d.ts +1 -1
  11. package/dist/ts/upload/index.d.ts +2 -0
  12. package/dist/ts/util/editorCommonEvent.d.ts +1 -1
  13. package/dist/types/index.d.ts +7 -5
  14. package/package.json +1 -1
  15. package/src/assets/less/_sv.less +2 -98
  16. package/src/assets/less/_wysiwyg.less +30 -0
  17. package/src/index.ts +45 -14
  18. package/src/ts/hint/index.ts +9 -4
  19. package/src/ts/ir/highlightToolbarIR.ts +4 -4
  20. package/src/ts/markdown/getMarkdown.ts +3 -3
  21. package/src/ts/sv/index.ts +37 -76
  22. package/src/ts/sv/process.ts +48 -164
  23. package/src/ts/sv/processKeydown.ts +19 -186
  24. package/src/ts/toolbar/EditMode.ts +3 -10
  25. package/src/ts/toolbar/Emoji.ts +8 -1
  26. package/src/ts/toolbar/Record.ts +10 -2
  27. package/src/ts/toolbar/index.ts +3 -0
  28. package/src/ts/ui/initUI.ts +7 -3
  29. package/src/ts/undo/index.ts +32 -17
  30. package/src/ts/upload/index.ts +42 -10
  31. package/src/ts/util/editorCommonEvent.ts +18 -9
  32. package/src/ts/util/fixBrowserBehavior.ts +106 -36
  33. package/src/ts/util/selection.ts +11 -3
  34. package/src/ts/wysiwyg/highlightToolbarWYSIWYG.ts +53 -1
  35. package/src/ts/wysiwyg/processKeydown.ts +47 -0
  36. package/dist/ts/sv/combineFootnote.d.ts +0 -6
  37. package/dist/ts/sv/inputEvent.d.ts +0 -1
  38. package/src/ts/sv/combineFootnote.ts +0 -27
  39. package/src/ts/sv/inputEvent.ts +0 -188
package/README.md CHANGED
@@ -225,6 +225,7 @@ Markdown 输出的 HTML 所展现的外观。内置 ant-design, light,dark,w
225
225
  | icon | 图标风格:ant, material | 'ant' |
226
226
  | customRenders: {language: string, render: (element: HTMLElement, vditor: IVditor) => void}[] | 自定义渲染器 | [] |
227
227
  | customWysiwygToolbar(type: TWYSISYGToolbar, element: HTMLElement): void | 对 wysiwyg 模式下的工具栏进行自定义 | - |
228
+ | customWysiwygMobileToolbar(type: TWYSISYGToolbar, element: HTMLElement): void | 对移动端 wysiwyg 模式下的工具栏进行自定义,未添加菜单项时不显示入口 | - |
228
229
 
229
230
  #### options.toolbar
230
231
 
package/dist/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vditor v3.11.3 - A markdown editor written in TypeScript.
2
+ * Vditor v4.0.0 - A markdown editor written in TypeScript.
3
3
  *
4
4
  * MIT License
5
5
  *
@@ -25,7 +25,7 @@
25
25
  *
26
26
  */
27
27
  /*!
28
- * Vditor v3.11.3 - A markdown editor written in TypeScript.
28
+ * Vditor v4.0.0 - A markdown editor written in TypeScript.
29
29
  *
30
30
  * MIT License
31
31
  *
@@ -1606,7 +1606,32 @@
1606
1606
  .vditor-wysiwyg div[data-type="link-ref-defs-block"] {
1607
1607
  color: var(--blockquote-color);
1608
1608
  }
1609
+ .vditor-wysiwyg__mobile-toolbar {
1610
+ display: none;
1611
+ }
1609
1612
  @media screen and (max-width: 520px) {
1613
+ .vditor-wysiwyg__mobile-toolbar {
1614
+ display: block;
1615
+ float: left;
1616
+ height: 21px;
1617
+ position: relative;
1618
+ width: 23px;
1619
+ }
1620
+ .vditor-wysiwyg__mobile-actions {
1621
+ box-sizing: border-box;
1622
+ flex-wrap: wrap;
1623
+ left: 0;
1624
+ padding: 5px;
1625
+ top: 26px;
1626
+ white-space: normal;
1627
+ }
1628
+ .vditor-wysiwyg__mobile-actions.vditor-panel--left {
1629
+ left: auto;
1630
+ right: 0;
1631
+ }
1632
+ .vditor-wysiwyg__mobile-actions--open {
1633
+ display: flex;
1634
+ }
1610
1635
  .vditor-wysiwyg h1:before,
1611
1636
  .vditor-wysiwyg h2:before,
1612
1637
  .vditor-wysiwyg h3:before,
@@ -1864,89 +1889,17 @@
1864
1889
  word-break: break-word;
1865
1890
  word-wrap: break-word;
1866
1891
  }
1867
- .vditor-sv[contenteditable="false"] {
1892
+ .vditor-sv:disabled {
1868
1893
  opacity: 0.3;
1869
1894
  cursor: not-allowed;
1870
1895
  }
1871
- .vditor-sv:empty::before {
1872
- content: attr(placeholder);
1896
+ .vditor-sv::-moz-placeholder {
1873
1897
  color: var(--second-color);
1874
1898
  }
1875
- .vditor-sv:focus {
1876
- background-color: var(--textarea-background-color);
1877
- }
1878
- .vditor-sv:after {
1879
- content: "";
1880
- height: var(--editor-bottom);
1881
- display: block;
1882
- }
1883
- .vditor-sv span[data-type="newline"] + span[data-type="text"]:empty {
1884
- display: inherit;
1885
- }
1886
- .vditor-sv .sup {
1887
- vertical-align: super;
1888
- font-size: smaller;
1889
- }
1890
- .vditor-sv .strong {
1891
- font-weight: bold;
1892
- }
1893
- .vditor-sv .em {
1894
- font-style: italic;
1895
- }
1896
- .vditor-sv .s {
1897
- text-decoration: line-through;
1898
- }
1899
- .vditor-sv .mark:not(.vditor-sv__marker) {
1900
- background-color: yellow;
1901
- color: black;
1902
- }
1903
- .vditor-sv .h1 {
1904
- font-size: 1.75em;
1905
- line-height: 44px;
1906
- }
1907
- .vditor-sv .h2 {
1908
- font-size: 1.55em;
1909
- line-height: 38px;
1910
- }
1911
- .vditor-sv .h3 {
1912
- font-size: 1.38em;
1913
- line-height: 27px;
1914
- }
1915
- .vditor-sv .h4 {
1916
- font-size: 1.25em;
1917
- line-height: 25px;
1918
- }
1919
- .vditor-sv .h5 {
1920
- font-size: 1.13em;
1921
- }
1922
- .vditor-sv .h6 {
1923
- font-size: 1em;
1924
- }
1925
- .vditor-sv__marker {
1899
+ .vditor-sv::placeholder {
1926
1900
  color: var(--second-color);
1927
1901
  }
1928
- .vditor-sv__marker--heading {
1929
- color: var(--ir-heading-color);
1930
- }
1931
- .vditor-sv__marker--bi {
1932
- color: var(--ir-bi-color);
1933
- }
1934
- .vditor-sv__marker--link {
1935
- color: var(--ir-link-color);
1936
- }
1937
- .vditor-sv__marker--title {
1938
- color: var(--ir-title-color);
1939
- }
1940
- .vditor-sv__marker--bracket {
1941
- color: var(--ir-bracket-color);
1942
- }
1943
- .vditor-sv__marker--paren {
1944
- color: var(--ir-paren-color);
1945
- }
1946
- .vditor-sv__marker--info {
1947
- color: var(--ir-heading-color);
1948
- }
1949
- .vditor-sv__marker--strong {
1950
- font-weight: bold;
1902
+ .vditor-sv:focus {
1903
+ background-color: var(--textarea-background-color);
1951
1904
  }
1952
1905